<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <script>
        /*var dayan=new Object();
        dayan.name="xiaohui";
        dayan.age="15";
        dayan.color="huise";
        alert("dayan.name:"+dayan.name+",age"+dayan.age+",color"+dayan.color);第一种定义方式*/
    </script>
    <script>
//        第二种定义方式
        var dayan={
            name:"xiaohui",
            age:"15",
            color:"huise"
        };
        document.write("dayan.name:"+dayan.name+",age:"+dayan.age+",color:"+dayan.color);
    </script>

    <script>
//        第三种定义方式
        var dayan={};
        dayan.name="xiaohui";
        dayan.age="15";
        dayan.color="huise";
        document.write("dayan.name:"+dayan.name+",age:"+dayan.age+",color:"+dayan.color)
    </script>
    <script>
//        函数的方法来定义,很重要
        function dayan(name,age){
            this.name=name;
            this.age=age;
        }
        son=new dayan("xiaohui",15);
        document.write("dayan.name:"+son.name+"<br/>"+",age:"+son.age);
    </script>
</body>
</html>